from appium.webdriver.common.appiumby import AppiumBy

from base.authorize_base import AuthorizeBase
from appium.webdriver import Remote


class AuthorizePage(AuthorizeBase):

    def reminder_agree_button_click(self, driver: Remote):
        reminder_agree_button_xpath = self.reminder_agree_button()
        return self.click_new(driver, locator_value=reminder_agree_button_xpath)

    def deviceInfo_agree_button_click(self, driver: Remote):
        deviceInfo_agree_button_xpath = self.deviceInfo_agree_button()
        return self.click_new(driver, locator_value=deviceInfo_agree_button_xpath)

    def newUserAd_close_button_click(self, driver: Remote):
        newUserAd_close_button_xpath = self.newUserAd_close_button()
        return self.click_new(driver, locator_value=newUserAd_close_button_xpath)

    def authorize_setup(self, drvier):
        self.reminder_agree_button_click(drvier)
        self.deviceInfo_agree_button_click(drvier)
        self.newUserAd_close_button_click(drvier)
